package com.mxy.myapplication2.java;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;

import com.mxy.myapplication2.R;

/**
 * Created by Administrator on 2017/11/8.
 */

public class SecondActivity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.w("MXY", "SecondActivity  getTaskId:" + getTaskId());
        setContentView(R.layout.activity_second);
        findViewById(R.id.button).setOnClickListener(this);
    }


    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        Log.w("MXY", "SecondActivity_onNewIntent");
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        Log.w("MXY", "SecondActivity_onActivityResult");
    }

    @Override
    public void onClick(View v) {
        startActivityForResult(new Intent(this, ThirdActivity.class), 1);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.w("MXY", "SecondActivity_销毁");
    }

    @Override
    public void onWindowFocusChanged(boolean hasFocus) {
        super.onWindowFocusChanged(hasFocus);
        Log.w("MXY", "secondActivity onWindowFocusChanged hasFocus = " + hasFocus);
    }
}
